#pragma once

namespace Graphics{
	class Quad : public Core::MemTrack, public boost::enable_shared_from_this<Quad>{
	public:
		Quad(Utility::Math::Vector<float,2> quads[4], Quad* parent = NULL){
			
		}

		void addContentId(unsigned int contentId){
			if(m_content.size() < 4){
				m_content.insert(contentId);
			}
			else{
				if(m_children.empty()){
					splitQuad();
				}
			}
		}

		void removeContentId(unsigned int contentId){
			if(m_content.find(contentId) != m_content.end()){
				m_content.erase(contentId);
			}
			else{
				
			}
		}


	private:
		void splitQuad(){
			
		}

		Utility::Math::Vector<float,2> m_quadPoints[4];
		std::set<unsigned int> m_content;
		std::set<boost::shared_ptr<Quad>> m_children;
		Quad* m_parent;
	};
}

typedef boost::shared_ptr<Graphics::Quad> QuadPtr;